// $ANTLR 3.1.2 D:\\Projekty\\Protege4Workspace\\org.protege.editor.owl.examples.tab\\src\\org\\protege\\owl\\examples\\tab\\grammar\\FOLStage4.g 2009-06-10 10:46:07

package org.protege.owl.examples.tab.grammar;

import org.protege.owl.examples.tab.*;
import java.util.Iterator;
import java.util.ArrayList;


import org.antlr.runtime.*;
import org.antlr.runtime.tree.*;import java.util.Stack;
import java.util.List;
import java.util.ArrayList;


public class FOLStage4 extends TreeParser {
    public static final String[] tokenNames = new String[] {
        "<invalid>", "<EOR>", "<DOWN>", "<UP>", "DOT", "NOT", "FORALL", "SEPARATOR", "EXISTS", "RANGE_CLAUSE", "ID", "OR", "AND", "IS", "STAT", "QTF", "NEG", "EXPR", "VAR", "REL", "NEWLINE", "WS", "','", "':'", "';'"
    };
    public static final int STAT=14;
    public static final int T__24=24;
    public static final int T__23=23;
    public static final int T__22=22;
    public static final int QTF=15;
    public static final int FORALL=6;
    public static final int REL=19;
    public static final int SEPARATOR=7;
    public static final int NOT=5;
    public static final int ID=10;
    public static final int AND=12;
    public static final int EOF=-1;
    public static final int WS=21;
    public static final int EXPR=17;
    public static final int NEWLINE=20;
    public static final int RANGE_CLAUSE=9;
    public static final int IS=13;
    public static final int NEG=16;
    public static final int OR=11;
    public static final int VAR=18;
    public static final int EXISTS=8;
    public static final int DOT=4;

    // delegates
    // delegators


        public FOLStage4(TreeNodeStream input) {
            this(input, new RecognizerSharedState());
        }
        public FOLStage4(TreeNodeStream input, RecognizerSharedState state) {
            super(input, state);
             
        }
        
    protected TreeAdaptor adaptor = new CommonTreeAdaptor();

    public void setTreeAdaptor(TreeAdaptor adaptor) {
        this.adaptor = adaptor;
    }
    public TreeAdaptor getTreeAdaptor() {
        return adaptor;
    }

    public String[] getTokenNames() { return FOLStage4.tokenNames; }
    public String getGrammarFileName() { return "D:\\Projekty\\Protege4Workspace\\org.protege.editor.owl.examples.tab\\src\\org\\protege\\owl\\examples\\tab\\grammar\\FOLStage4.g"; }


    public void setEnvironment(PredicateRegistry pr, VariableRegistry vr)
    {
    	predicateRegistry = pr;
    	variableRegistry = vr;
    	variableRegistry.clear();
    	return;
    }

    public void clear()
    {
    	quantifierResultList.clear();
    	quantifierString = "";
    	return;
    }

    public ResultTable getResultTable()
    {
    	return queryResultTable;
    }

    private void executeQuery()
    {
    	try
    	{
    		int size = quantifierString.length();
       	for (int i=size-1;i>=0;i--)
       	{
       		// Zlaczenie ze zliczaniem dopasowania dla pierszej tabeli
       		Integer fitSize = 0;
       		queryResultTable = ResultTable.and(quantifierResultList.get(i), queryResultTable, fitSize);
       		fitSize = ResultTable.getFitSize();
       		   		
       		System.out.println("Fit size:" + fitSize);
       		// Sprawdzenie spelnialnosci kwantyfikatora
       		int resultSize = queryResultTable.size();
       		int quantifierSize = quantifierResultList.get(i).size();
       		String quantifierKind = quantifierString.substring(i,i+1);
       		// Kwantyfikator ogolny
       		if (quantifierKind.compareTo("A")==0)
       		{
       			// a moze odwrotnie -> quantifierSize < resultSize ?
       			if (fitSize<quantifierSize)
       			{
       				queryResultTable = new ResultTable();
       				break;
       			}
       		}
       		else
       		// Kwantyfikator szczegolny
       		if (quantifierKind.compareTo("E")==0)
       		{
       			if (fitSize<1)
       			{
       				queryResultTable = new ResultTable();
       				break;
       			}
       		}
       		else
       		// Cos sie pochrzanilo
       		{
       			queryResultTable = new ResultTable();
       			break;
       		}
       	}
       }
       catch(Exception e)
       {
       	e.printStackTrace();
    	ErrorLogger.log(e);
       }
       return;
    }

    //private Object sample;

    private PredicateRegistry predicateRegistry;

    private VariableRegistry variableRegistry;

    private ArrayList<ResultTable> quantifierResultList = new ArrayList<ResultTable>();

    private String quantifierString = "";

    private ResultTable queryResultTable;


    public static class stat_return extends TreeRuleReturnScope {
        CommonTree tree;
        public Object getTree() { return tree; }
    };

    // $ANTLR start "stat"
    // D:\\Projekty\\Protege4Workspace\\org.protege.editor.owl.examples.tab\\src\\org\\protege\\owl\\examples\\tab\\grammar\\FOLStage4.g:109:1: stat : ^( STAT qtflist expr ) ;
    public final FOLStage4.stat_return stat() throws RecognitionException {
        FOLStage4.stat_return retval = new FOLStage4.stat_return();
        retval.start = input.LT(1);

        CommonTree root_0 = null;

        CommonTree _first_0 = null;
        CommonTree _last = null;

        CommonTree STAT1=null;
        FOLStage4.qtflist_return qtflist2 = null;

        FOLStage4.expr_return expr3 = null;


        CommonTree STAT1_tree=null;

        try {
            // D:\\Projekty\\Protege4Workspace\\org.protege.editor.owl.examples.tab\\src\\org\\protege\\owl\\examples\\tab\\grammar\\FOLStage4.g:109:5: ( ^( STAT qtflist expr ) )
            // D:\\Projekty\\Protege4Workspace\\org.protege.editor.owl.examples.tab\\src\\org\\protege\\owl\\examples\\tab\\grammar\\FOLStage4.g:110:2: ^( STAT qtflist expr )
            {
            root_0 = (CommonTree)adaptor.nil();

            _last = (CommonTree)input.LT(1);
            {
            CommonTree _save_last_1 = _last;
            CommonTree _first_1 = null;
            CommonTree root_1 = (CommonTree)adaptor.nil();_last = (CommonTree)input.LT(1);
            STAT1=(CommonTree)match(input,STAT,FOLLOW_STAT_in_stat50); 
            STAT1_tree = (CommonTree)adaptor.dupNode(STAT1);

            root_1 = (CommonTree)adaptor.becomeRoot(STAT1_tree, root_1);



            match(input, Token.DOWN, null); 
            _last = (CommonTree)input.LT(1);
            pushFollow(FOLLOW_qtflist_in_stat52);
            qtflist2=qtflist();

            state._fsp--;

            adaptor.addChild(root_1, qtflist2.getTree());
            _last = (CommonTree)input.LT(1);
            pushFollow(FOLLOW_expr_in_stat54);
            expr3=expr();

            state._fsp--;

            adaptor.addChild(root_1, expr3.getTree());

            match(input, Token.UP, null); adaptor.addChild(root_0, root_1);_last = _save_last_1;
            }


            		queryResultTable = (expr3!=null?expr3.resultTable:null);
            		executeQuery();
            	

            }

            retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {
        }
        return retval;
    }
    // $ANTLR end "stat"

    public static class qtflist_return extends TreeRuleReturnScope {
        CommonTree tree;
        public Object getTree() { return tree; }
    };

    // $ANTLR start "qtflist"
    // D:\\Projekty\\Protege4Workspace\\org.protege.editor.owl.examples.tab\\src\\org\\protege\\owl\\examples\\tab\\grammar\\FOLStage4.g:117:1: qtflist : ^( QTF ( qtf )* ) ;
    public final FOLStage4.qtflist_return qtflist() throws RecognitionException {
        FOLStage4.qtflist_return retval = new FOLStage4.qtflist_return();
        retval.start = input.LT(1);

        CommonTree root_0 = null;

        CommonTree _first_0 = null;
        CommonTree _last = null;

        CommonTree QTF4=null;
        FOLStage4.qtf_return qtf5 = null;


        CommonTree QTF4_tree=null;

        try {
            // D:\\Projekty\\Protege4Workspace\\org.protege.editor.owl.examples.tab\\src\\org\\protege\\owl\\examples\\tab\\grammar\\FOLStage4.g:117:8: ( ^( QTF ( qtf )* ) )
            // D:\\Projekty\\Protege4Workspace\\org.protege.editor.owl.examples.tab\\src\\org\\protege\\owl\\examples\\tab\\grammar\\FOLStage4.g:118:2: ^( QTF ( qtf )* )
            {
            root_0 = (CommonTree)adaptor.nil();

            _last = (CommonTree)input.LT(1);
            {
            CommonTree _save_last_1 = _last;
            CommonTree _first_1 = null;
            CommonTree root_1 = (CommonTree)adaptor.nil();_last = (CommonTree)input.LT(1);
            QTF4=(CommonTree)match(input,QTF,FOLLOW_QTF_in_qtflist70); 
            QTF4_tree = (CommonTree)adaptor.dupNode(QTF4);

            root_1 = (CommonTree)adaptor.becomeRoot(QTF4_tree, root_1);



            if ( input.LA(1)==Token.DOWN ) {
                match(input, Token.DOWN, null); 
                // D:\\Projekty\\Protege4Workspace\\org.protege.editor.owl.examples.tab\\src\\org\\protege\\owl\\examples\\tab\\grammar\\FOLStage4.g:118:8: ( qtf )*
                loop1:
                do {
                    int alt1=2;
                    int LA1_0 = input.LA(1);

                    if ( (LA1_0==FORALL||LA1_0==EXISTS) ) {
                        alt1=1;
                    }


                    switch (alt1) {
                	case 1 :
                	    // D:\\Projekty\\Protege4Workspace\\org.protege.editor.owl.examples.tab\\src\\org\\protege\\owl\\examples\\tab\\grammar\\FOLStage4.g:118:8: qtf
                	    {
                	    _last = (CommonTree)input.LT(1);
                	    pushFollow(FOLLOW_qtf_in_qtflist72);
                	    qtf5=qtf();

                	    state._fsp--;

                	    adaptor.addChild(root_1, qtf5.getTree());

                	    }
                	    break;

                	default :
                	    break loop1;
                    }
                } while (true);


                match(input, Token.UP, null); 
            }adaptor.addChild(root_0, root_1);_last = _save_last_1;
            }


            }

            retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {
        }
        return retval;
    }
    // $ANTLR end "qtflist"

    public static class qtf_return extends TreeRuleReturnScope {
        CommonTree tree;
        public Object getTree() { return tree; }
    };

    // $ANTLR start "qtf"
    // D:\\Projekty\\Protege4Workspace\\org.protege.editor.owl.examples.tab\\src\\org\\protege\\owl\\examples\\tab\\grammar\\FOLStage4.g:121:1: qtf : ( forall | exists );
    public final FOLStage4.qtf_return qtf() throws RecognitionException {
        FOLStage4.qtf_return retval = new FOLStage4.qtf_return();
        retval.start = input.LT(1);

        CommonTree root_0 = null;

        CommonTree _first_0 = null;
        CommonTree _last = null;

        FOLStage4.forall_return forall6 = null;

        FOLStage4.exists_return exists7 = null;



        try {
            // D:\\Projekty\\Protege4Workspace\\org.protege.editor.owl.examples.tab\\src\\org\\protege\\owl\\examples\\tab\\grammar\\FOLStage4.g:121:4: ( forall | exists )
            int alt2=2;
            int LA2_0 = input.LA(1);

            if ( (LA2_0==FORALL) ) {
                alt2=1;
            }
            else if ( (LA2_0==EXISTS) ) {
                alt2=2;
            }
            else {
                NoViableAltException nvae =
                    new NoViableAltException("", 2, 0, input);

                throw nvae;
            }
            switch (alt2) {
                case 1 :
                    // D:\\Projekty\\Protege4Workspace\\org.protege.editor.owl.examples.tab\\src\\org\\protege\\owl\\examples\\tab\\grammar\\FOLStage4.g:122:2: forall
                    {
                    root_0 = (CommonTree)adaptor.nil();

                    _last = (CommonTree)input.LT(1);
                    pushFollow(FOLLOW_forall_in_qtf84);
                    forall6=forall();

                    state._fsp--;

                    adaptor.addChild(root_0, forall6.getTree());

                    }
                    break;
                case 2 :
                    // D:\\Projekty\\Protege4Workspace\\org.protege.editor.owl.examples.tab\\src\\org\\protege\\owl\\examples\\tab\\grammar\\FOLStage4.g:124:2: exists
                    {
                    root_0 = (CommonTree)adaptor.nil();

                    _last = (CommonTree)input.LT(1);
                    pushFollow(FOLLOW_exists_in_qtf90);
                    exists7=exists();

                    state._fsp--;

                    adaptor.addChild(root_0, exists7.getTree());

                    }
                    break;

            }
            retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {
        }
        return retval;
    }
    // $ANTLR end "qtf"

    public static class forall_return extends TreeRuleReturnScope {
        CommonTree tree;
        public Object getTree() { return tree; }
    };

    // $ANTLR start "forall"
    // D:\\Projekty\\Protege4Workspace\\org.protege.editor.owl.examples.tab\\src\\org\\protege\\owl\\examples\\tab\\grammar\\FOLStage4.g:127:1: forall : ^( FORALL rng ) ;
    public final FOLStage4.forall_return forall() throws RecognitionException {
        FOLStage4.forall_return retval = new FOLStage4.forall_return();
        retval.start = input.LT(1);

        CommonTree root_0 = null;

        CommonTree _first_0 = null;
        CommonTree _last = null;

        CommonTree FORALL8=null;
        FOLStage4.rng_return rng9 = null;


        CommonTree FORALL8_tree=null;

        try {
            // D:\\Projekty\\Protege4Workspace\\org.protege.editor.owl.examples.tab\\src\\org\\protege\\owl\\examples\\tab\\grammar\\FOLStage4.g:127:7: ( ^( FORALL rng ) )
            // D:\\Projekty\\Protege4Workspace\\org.protege.editor.owl.examples.tab\\src\\org\\protege\\owl\\examples\\tab\\grammar\\FOLStage4.g:128:2: ^( FORALL rng )
            {
            root_0 = (CommonTree)adaptor.nil();

            _last = (CommonTree)input.LT(1);
            {
            CommonTree _save_last_1 = _last;
            CommonTree _first_1 = null;
            CommonTree root_1 = (CommonTree)adaptor.nil();_last = (CommonTree)input.LT(1);
            FORALL8=(CommonTree)match(input,FORALL,FOLLOW_FORALL_in_forall101); 
            FORALL8_tree = (CommonTree)adaptor.dupNode(FORALL8);

            root_1 = (CommonTree)adaptor.becomeRoot(FORALL8_tree, root_1);



            match(input, Token.DOWN, null); 
            _last = (CommonTree)input.LT(1);
            pushFollow(FOLLOW_rng_in_forall103);
            rng9=rng();

            state._fsp--;

            adaptor.addChild(root_1, rng9.getTree());

            match(input, Token.UP, null); adaptor.addChild(root_0, root_1);_last = _save_last_1;
            }


            		quantifierResultList.add((rng9!=null?rng9.resultTable:null));
            		quantifierString = quantifierString + "A";
            	

            }

            retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {
        }
        return retval;
    }
    // $ANTLR end "forall"

    public static class exists_return extends TreeRuleReturnScope {
        CommonTree tree;
        public Object getTree() { return tree; }
    };

    // $ANTLR start "exists"
    // D:\\Projekty\\Protege4Workspace\\org.protege.editor.owl.examples.tab\\src\\org\\protege\\owl\\examples\\tab\\grammar\\FOLStage4.g:135:1: exists : ^( EXISTS rng ) ;
    public final FOLStage4.exists_return exists() throws RecognitionException {
        FOLStage4.exists_return retval = new FOLStage4.exists_return();
        retval.start = input.LT(1);

        CommonTree root_0 = null;

        CommonTree _first_0 = null;
        CommonTree _last = null;

        CommonTree EXISTS10=null;
        FOLStage4.rng_return rng11 = null;


        CommonTree EXISTS10_tree=null;

        try {
            // D:\\Projekty\\Protege4Workspace\\org.protege.editor.owl.examples.tab\\src\\org\\protege\\owl\\examples\\tab\\grammar\\FOLStage4.g:135:7: ( ^( EXISTS rng ) )
            // D:\\Projekty\\Protege4Workspace\\org.protege.editor.owl.examples.tab\\src\\org\\protege\\owl\\examples\\tab\\grammar\\FOLStage4.g:136:2: ^( EXISTS rng )
            {
            root_0 = (CommonTree)adaptor.nil();

            _last = (CommonTree)input.LT(1);
            {
            CommonTree _save_last_1 = _last;
            CommonTree _first_1 = null;
            CommonTree root_1 = (CommonTree)adaptor.nil();_last = (CommonTree)input.LT(1);
            EXISTS10=(CommonTree)match(input,EXISTS,FOLLOW_EXISTS_in_exists118); 
            EXISTS10_tree = (CommonTree)adaptor.dupNode(EXISTS10);

            root_1 = (CommonTree)adaptor.becomeRoot(EXISTS10_tree, root_1);



            match(input, Token.DOWN, null); 
            _last = (CommonTree)input.LT(1);
            pushFollow(FOLLOW_rng_in_exists120);
            rng11=rng();

            state._fsp--;

            adaptor.addChild(root_1, rng11.getTree());

            match(input, Token.UP, null); adaptor.addChild(root_0, root_1);_last = _save_last_1;
            }


            		quantifierResultList.add((rng11!=null?rng11.resultTable:null));
            		quantifierString = quantifierString + "E";
            	

            }

            retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {
        }
        return retval;
    }
    // $ANTLR end "exists"

    public static class rng_return extends TreeRuleReturnScope {
        public ResultTable resultTable;
        CommonTree tree;
        public Object getTree() { return tree; }
    };

    // $ANTLR start "rng"
    // D:\\Projekty\\Protege4Workspace\\org.protege.editor.owl.examples.tab\\src\\org\\protege\\owl\\examples\\tab\\grammar\\FOLStage4.g:143:1: rng returns [ResultTable resultTable] : varlist ^( EXPR expr ) ;
    public final FOLStage4.rng_return rng() throws RecognitionException {
        FOLStage4.rng_return retval = new FOLStage4.rng_return();
        retval.start = input.LT(1);

        CommonTree root_0 = null;

        CommonTree _first_0 = null;
        CommonTree _last = null;

        CommonTree EXPR13=null;
        FOLStage4.varlist_return varlist12 = null;

        FOLStage4.expr_return expr14 = null;


        CommonTree EXPR13_tree=null;

        try {
            // D:\\Projekty\\Protege4Workspace\\org.protege.editor.owl.examples.tab\\src\\org\\protege\\owl\\examples\\tab\\grammar\\FOLStage4.g:144:1: ( varlist ^( EXPR expr ) )
            // D:\\Projekty\\Protege4Workspace\\org.protege.editor.owl.examples.tab\\src\\org\\protege\\owl\\examples\\tab\\grammar\\FOLStage4.g:145:2: varlist ^( EXPR expr )
            {
            root_0 = (CommonTree)adaptor.nil();

            _last = (CommonTree)input.LT(1);
            pushFollow(FOLLOW_varlist_in_rng139);
            varlist12=varlist();

            state._fsp--;

            adaptor.addChild(root_0, varlist12.getTree());
            _last = (CommonTree)input.LT(1);
            {
            CommonTree _save_last_1 = _last;
            CommonTree _first_1 = null;
            CommonTree root_1 = (CommonTree)adaptor.nil();_last = (CommonTree)input.LT(1);
            EXPR13=(CommonTree)match(input,EXPR,FOLLOW_EXPR_in_rng142); 
            EXPR13_tree = (CommonTree)adaptor.dupNode(EXPR13);

            root_1 = (CommonTree)adaptor.becomeRoot(EXPR13_tree, root_1);



            match(input, Token.DOWN, null); 
            _last = (CommonTree)input.LT(1);
            pushFollow(FOLLOW_expr_in_rng144);
            expr14=expr();

            state._fsp--;

            adaptor.addChild(root_1, expr14.getTree());

            match(input, Token.UP, null); adaptor.addChild(root_0, root_1);_last = _save_last_1;
            }


            		retval.resultTable = (expr14!=null?expr14.resultTable:null);
            	

            }

            retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {
        }
        return retval;
    }
    // $ANTLR end "rng"

    public static class varlist_return extends TreeRuleReturnScope {
        CommonTree tree;
        public Object getTree() { return tree; }
    };

    // $ANTLR start "varlist"
    // D:\\Projekty\\Protege4Workspace\\org.protege.editor.owl.examples.tab\\src\\org\\protege\\owl\\examples\\tab\\grammar\\FOLStage4.g:151:1: varlist : ^( VAR (ids+= ID )+ ) ;
    public final FOLStage4.varlist_return varlist() throws RecognitionException {
        FOLStage4.varlist_return retval = new FOLStage4.varlist_return();
        retval.start = input.LT(1);

        CommonTree root_0 = null;

        CommonTree _first_0 = null;
        CommonTree _last = null;

        CommonTree VAR15=null;
        CommonTree ids=null;
        List list_ids=null;

        CommonTree VAR15_tree=null;
        CommonTree ids_tree=null;

        try {
            // D:\\Projekty\\Protege4Workspace\\org.protege.editor.owl.examples.tab\\src\\org\\protege\\owl\\examples\\tab\\grammar\\FOLStage4.g:152:1: ( ^( VAR (ids+= ID )+ ) )
            // D:\\Projekty\\Protege4Workspace\\org.protege.editor.owl.examples.tab\\src\\org\\protege\\owl\\examples\\tab\\grammar\\FOLStage4.g:153:2: ^( VAR (ids+= ID )+ )
            {
            root_0 = (CommonTree)adaptor.nil();

            _last = (CommonTree)input.LT(1);
            {
            CommonTree _save_last_1 = _last;
            CommonTree _first_1 = null;
            CommonTree root_1 = (CommonTree)adaptor.nil();_last = (CommonTree)input.LT(1);
            VAR15=(CommonTree)match(input,VAR,FOLLOW_VAR_in_varlist160); 
            VAR15_tree = (CommonTree)adaptor.dupNode(VAR15);

            root_1 = (CommonTree)adaptor.becomeRoot(VAR15_tree, root_1);



            match(input, Token.DOWN, null); 
            // D:\\Projekty\\Protege4Workspace\\org.protege.editor.owl.examples.tab\\src\\org\\protege\\owl\\examples\\tab\\grammar\\FOLStage4.g:153:11: (ids+= ID )+
            int cnt3=0;
            loop3:
            do {
                int alt3=2;
                int LA3_0 = input.LA(1);

                if ( (LA3_0==ID) ) {
                    alt3=1;
                }


                switch (alt3) {
            	case 1 :
            	    // D:\\Projekty\\Protege4Workspace\\org.protege.editor.owl.examples.tab\\src\\org\\protege\\owl\\examples\\tab\\grammar\\FOLStage4.g:153:11: ids+= ID
            	    {
            	    _last = (CommonTree)input.LT(1);
            	    ids=(CommonTree)match(input,ID,FOLLOW_ID_in_varlist164); 
            	    ids_tree = (CommonTree)adaptor.dupNode(ids);

            	    adaptor.addChild(root_1, ids_tree);

            	    if (list_ids==null) list_ids=new ArrayList();
            	    list_ids.add(ids);


            	    }
            	    break;

            	default :
            	    if ( cnt3 >= 1 ) break loop3;
                        EarlyExitException eee =
                            new EarlyExitException(3, input);
                        throw eee;
                }
                cnt3++;
            } while (true);


            match(input, Token.UP, null); adaptor.addChild(root_0, root_1);_last = _save_last_1;
            }


            		Iterator iter = list_ids.iterator();
            		while(iter.hasNext())
            		{
            			String id = ((CommonTree)iter.next()).getText();
            			variableRegistry.add(new Variable(id));
            		}
            	

            }

            retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {
        }
        return retval;
    }
    // $ANTLR end "varlist"

    public static class expr_return extends TreeRuleReturnScope {
        public ResultTable resultTable;
        CommonTree tree;
        public Object getTree() { return tree; }
    };

    // $ANTLR start "expr"
    // D:\\Projekty\\Protege4Workspace\\org.protege.editor.owl.examples.tab\\src\\org\\protege\\owl\\examples\\tab\\grammar\\FOLStage4.g:164:1: expr returns [ResultTable resultTable] : ( or | and | quark );
    public final FOLStage4.expr_return expr() throws RecognitionException {
        FOLStage4.expr_return retval = new FOLStage4.expr_return();
        retval.start = input.LT(1);

        CommonTree root_0 = null;

        CommonTree _first_0 = null;
        CommonTree _last = null;

        FOLStage4.or_return or16 = null;

        FOLStage4.and_return and17 = null;

        FOLStage4.quark_return quark18 = null;



        try {
            // D:\\Projekty\\Protege4Workspace\\org.protege.editor.owl.examples.tab\\src\\org\\protege\\owl\\examples\\tab\\grammar\\FOLStage4.g:165:1: ( or | and | quark )
            int alt4=3;
            switch ( input.LA(1) ) {
            case OR:
                {
                alt4=1;
                }
                break;
            case AND:
                {
                alt4=2;
                }
                break;
            case NOT:
            case IS:
            case REL:
                {
                alt4=3;
                }
                break;
            default:
                NoViableAltException nvae =
                    new NoViableAltException("", 4, 0, input);

                throw nvae;
            }

            switch (alt4) {
                case 1 :
                    // D:\\Projekty\\Protege4Workspace\\org.protege.editor.owl.examples.tab\\src\\org\\protege\\owl\\examples\\tab\\grammar\\FOLStage4.g:166:2: or
                    {
                    root_0 = (CommonTree)adaptor.nil();

                    _last = (CommonTree)input.LT(1);
                    pushFollow(FOLLOW_or_in_expr184);
                    or16=or();

                    state._fsp--;

                    adaptor.addChild(root_0, or16.getTree());

                    		retval.resultTable = (or16!=null?or16.resultTable:null);
                    	

                    }
                    break;
                case 2 :
                    // D:\\Projekty\\Protege4Workspace\\org.protege.editor.owl.examples.tab\\src\\org\\protege\\owl\\examples\\tab\\grammar\\FOLStage4.g:171:2: and
                    {
                    root_0 = (CommonTree)adaptor.nil();

                    _last = (CommonTree)input.LT(1);
                    pushFollow(FOLLOW_and_in_expr193);
                    and17=and();

                    state._fsp--;

                    adaptor.addChild(root_0, and17.getTree());

                    		retval.resultTable = (and17!=null?and17.resultTable:null);
                    	

                    }
                    break;
                case 3 :
                    // D:\\Projekty\\Protege4Workspace\\org.protege.editor.owl.examples.tab\\src\\org\\protege\\owl\\examples\\tab\\grammar\\FOLStage4.g:176:2: quark
                    {
                    root_0 = (CommonTree)adaptor.nil();

                    _last = (CommonTree)input.LT(1);
                    pushFollow(FOLLOW_quark_in_expr202);
                    quark18=quark();

                    state._fsp--;

                    adaptor.addChild(root_0, quark18.getTree());

                    		retval.resultTable = (quark18!=null?quark18.resultTable:null);
                    	

                    }
                    break;

            }
            retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {
        }
        return retval;
    }
    // $ANTLR end "expr"

    public static class or_return extends TreeRuleReturnScope {
        public ResultTable resultTable;
        CommonTree tree;
        public Object getTree() { return tree; }
    };

    // $ANTLR start "or"
    // D:\\Projekty\\Protege4Workspace\\org.protege.editor.owl.examples.tab\\src\\org\\protege\\owl\\examples\\tab\\grammar\\FOLStage4.g:182:1: or returns [ResultTable resultTable] : ^( OR expr1= expr expr2= expr ) ;
    public final FOLStage4.or_return or() throws RecognitionException {
        FOLStage4.or_return retval = new FOLStage4.or_return();
        retval.start = input.LT(1);

        CommonTree root_0 = null;

        CommonTree _first_0 = null;
        CommonTree _last = null;

        CommonTree OR19=null;
        FOLStage4.expr_return expr1 = null;

        FOLStage4.expr_return expr2 = null;


        CommonTree OR19_tree=null;

        try {
            // D:\\Projekty\\Protege4Workspace\\org.protege.editor.owl.examples.tab\\src\\org\\protege\\owl\\examples\\tab\\grammar\\FOLStage4.g:183:1: ( ^( OR expr1= expr expr2= expr ) )
            // D:\\Projekty\\Protege4Workspace\\org.protege.editor.owl.examples.tab\\src\\org\\protege\\owl\\examples\\tab\\grammar\\FOLStage4.g:184:2: ^( OR expr1= expr expr2= expr )
            {
            root_0 = (CommonTree)adaptor.nil();

            _last = (CommonTree)input.LT(1);
            {
            CommonTree _save_last_1 = _last;
            CommonTree _first_1 = null;
            CommonTree root_1 = (CommonTree)adaptor.nil();_last = (CommonTree)input.LT(1);
            OR19=(CommonTree)match(input,OR,FOLLOW_OR_in_or222); 
            OR19_tree = (CommonTree)adaptor.dupNode(OR19);

            root_1 = (CommonTree)adaptor.becomeRoot(OR19_tree, root_1);



            match(input, Token.DOWN, null); 
            _last = (CommonTree)input.LT(1);
            pushFollow(FOLLOW_expr_in_or226);
            expr1=expr();

            state._fsp--;

            adaptor.addChild(root_1, expr1.getTree());
            _last = (CommonTree)input.LT(1);
            pushFollow(FOLLOW_expr_in_or230);
            expr2=expr();

            state._fsp--;

            adaptor.addChild(root_1, expr2.getTree());

            match(input, Token.UP, null); adaptor.addChild(root_0, root_1);_last = _save_last_1;
            }


            		try
            		{
            			retval.resultTable = ResultTable.or((expr1!=null?expr1.resultTable:null), (expr2!=null?expr2.resultTable:null));
            		}
            		catch(Exception e)
            		{
            			e.printStackTrace();
            			ErrorLogger.log(e);
            		}
            	

            }

            retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {
        }
        return retval;
    }
    // $ANTLR end "or"

    public static class and_return extends TreeRuleReturnScope {
        public ResultTable resultTable;
        CommonTree tree;
        public Object getTree() { return tree; }
    };

    // $ANTLR start "and"
    // D:\\Projekty\\Protege4Workspace\\org.protege.editor.owl.examples.tab\\src\\org\\protege\\owl\\examples\\tab\\grammar\\FOLStage4.g:198:1: and returns [ResultTable resultTable] : ^( AND expr1= expr expr2= expr ) ;
    public final FOLStage4.and_return and() throws RecognitionException {
        FOLStage4.and_return retval = new FOLStage4.and_return();
        retval.start = input.LT(1);

        CommonTree root_0 = null;

        CommonTree _first_0 = null;
        CommonTree _last = null;

        CommonTree AND20=null;
        FOLStage4.expr_return expr1 = null;

        FOLStage4.expr_return expr2 = null;


        CommonTree AND20_tree=null;

        try {
            // D:\\Projekty\\Protege4Workspace\\org.protege.editor.owl.examples.tab\\src\\org\\protege\\owl\\examples\\tab\\grammar\\FOLStage4.g:199:1: ( ^( AND expr1= expr expr2= expr ) )
            // D:\\Projekty\\Protege4Workspace\\org.protege.editor.owl.examples.tab\\src\\org\\protege\\owl\\examples\\tab\\grammar\\FOLStage4.g:200:2: ^( AND expr1= expr expr2= expr )
            {
            root_0 = (CommonTree)adaptor.nil();

            _last = (CommonTree)input.LT(1);
            {
            CommonTree _save_last_1 = _last;
            CommonTree _first_1 = null;
            CommonTree root_1 = (CommonTree)adaptor.nil();_last = (CommonTree)input.LT(1);
            AND20=(CommonTree)match(input,AND,FOLLOW_AND_in_and251); 
            AND20_tree = (CommonTree)adaptor.dupNode(AND20);

            root_1 = (CommonTree)adaptor.becomeRoot(AND20_tree, root_1);



            match(input, Token.DOWN, null); 
            _last = (CommonTree)input.LT(1);
            pushFollow(FOLLOW_expr_in_and255);
            expr1=expr();

            state._fsp--;

            adaptor.addChild(root_1, expr1.getTree());
            _last = (CommonTree)input.LT(1);
            pushFollow(FOLLOW_expr_in_and259);
            expr2=expr();

            state._fsp--;

            adaptor.addChild(root_1, expr2.getTree());

            match(input, Token.UP, null); adaptor.addChild(root_0, root_1);_last = _save_last_1;
            }


            		try
            		{
            			retval.resultTable = ResultTable.and((expr1!=null?expr1.resultTable:null), (expr2!=null?expr2.resultTable:null));
            		}
            		catch(Exception e)
            		{
            			e.printStackTrace();
            			ErrorLogger.log(e);
            		}
            	

            }

            retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {
        }
        return retval;
    }
    // $ANTLR end "and"

    public static class quark_return extends TreeRuleReturnScope {
        public ResultTable resultTable;
        CommonTree tree;
        public Object getTree() { return tree; }
    };

    // $ANTLR start "quark"
    // D:\\Projekty\\Protege4Workspace\\org.protege.editor.owl.examples.tab\\src\\org\\protege\\owl\\examples\\tab\\grammar\\FOLStage4.g:214:1: quark returns [ResultTable resultTable] : ( predcall[true] | ^( NOT predcall[false] ) );
    public final FOLStage4.quark_return quark() throws RecognitionException {
        FOLStage4.quark_return retval = new FOLStage4.quark_return();
        retval.start = input.LT(1);

        CommonTree root_0 = null;

        CommonTree _first_0 = null;
        CommonTree _last = null;

        CommonTree NOT22=null;
        FOLStage4.predcall_return predcall21 = null;

        FOLStage4.predcall_return predcall23 = null;


        CommonTree NOT22_tree=null;

        try {
            // D:\\Projekty\\Protege4Workspace\\org.protege.editor.owl.examples.tab\\src\\org\\protege\\owl\\examples\\tab\\grammar\\FOLStage4.g:215:1: ( predcall[true] | ^( NOT predcall[false] ) )
            int alt5=2;
            int LA5_0 = input.LA(1);

            if ( (LA5_0==IS||LA5_0==REL) ) {
                alt5=1;
            }
            else if ( (LA5_0==NOT) ) {
                alt5=2;
            }
            else {
                NoViableAltException nvae =
                    new NoViableAltException("", 5, 0, input);

                throw nvae;
            }
            switch (alt5) {
                case 1 :
                    // D:\\Projekty\\Protege4Workspace\\org.protege.editor.owl.examples.tab\\src\\org\\protege\\owl\\examples\\tab\\grammar\\FOLStage4.g:216:2: predcall[true]
                    {
                    root_0 = (CommonTree)adaptor.nil();

                    _last = (CommonTree)input.LT(1);
                    pushFollow(FOLLOW_predcall_in_quark278);
                    predcall21=predcall(true);

                    state._fsp--;

                    adaptor.addChild(root_0, predcall21.getTree());

                    		retval.resultTable = (predcall21!=null?predcall21.resultTable:null);
                    	

                    }
                    break;
                case 2 :
                    // D:\\Projekty\\Protege4Workspace\\org.protege.editor.owl.examples.tab\\src\\org\\protege\\owl\\examples\\tab\\grammar\\FOLStage4.g:221:2: ^( NOT predcall[false] )
                    {
                    root_0 = (CommonTree)adaptor.nil();

                    _last = (CommonTree)input.LT(1);
                    {
                    CommonTree _save_last_1 = _last;
                    CommonTree _first_1 = null;
                    CommonTree root_1 = (CommonTree)adaptor.nil();_last = (CommonTree)input.LT(1);
                    NOT22=(CommonTree)match(input,NOT,FOLLOW_NOT_in_quark289); 
                    NOT22_tree = (CommonTree)adaptor.dupNode(NOT22);

                    root_1 = (CommonTree)adaptor.becomeRoot(NOT22_tree, root_1);



                    match(input, Token.DOWN, null); 
                    _last = (CommonTree)input.LT(1);
                    pushFollow(FOLLOW_predcall_in_quark291);
                    predcall23=predcall(false);

                    state._fsp--;

                    adaptor.addChild(root_1, predcall23.getTree());

                    match(input, Token.UP, null); adaptor.addChild(root_0, root_1);_last = _save_last_1;
                    }


                    		retval.resultTable = (predcall23!=null?predcall23.resultTable:null);
                    	

                    }
                    break;

            }
            retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {
        }
        return retval;
    }
    // $ANTLR end "quark"

    public static class predcall_return extends TreeRuleReturnScope {
        public ResultTable resultTable;
        CommonTree tree;
        public Object getTree() { return tree; }
    };

    // $ANTLR start "predcall"
    // D:\\Projekty\\Protege4Workspace\\org.protege.editor.owl.examples.tab\\src\\org\\protege\\owl\\examples\\tab\\grammar\\FOLStage4.g:227:1: predcall[boolean negval] returns [ResultTable resultTable] : ( ^( IS ID arg ) | ^( REL ID arg1= arg arg2= arg ) );
    public final FOLStage4.predcall_return predcall(boolean negval) throws RecognitionException {
        FOLStage4.predcall_return retval = new FOLStage4.predcall_return();
        retval.start = input.LT(1);

        CommonTree root_0 = null;

        CommonTree _first_0 = null;
        CommonTree _last = null;

        CommonTree IS24=null;
        CommonTree ID25=null;
        CommonTree REL27=null;
        CommonTree ID28=null;
        FOLStage4.arg_return arg1 = null;

        FOLStage4.arg_return arg2 = null;

        FOLStage4.arg_return arg26 = null;


        CommonTree IS24_tree=null;
        CommonTree ID25_tree=null;
        CommonTree REL27_tree=null;
        CommonTree ID28_tree=null;

        try {
            // D:\\Projekty\\Protege4Workspace\\org.protege.editor.owl.examples.tab\\src\\org\\protege\\owl\\examples\\tab\\grammar\\FOLStage4.g:228:1: ( ^( IS ID arg ) | ^( REL ID arg1= arg arg2= arg ) )
            int alt6=2;
            int LA6_0 = input.LA(1);

            if ( (LA6_0==IS) ) {
                alt6=1;
            }
            else if ( (LA6_0==REL) ) {
                alt6=2;
            }
            else {
                NoViableAltException nvae =
                    new NoViableAltException("", 6, 0, input);

                throw nvae;
            }
            switch (alt6) {
                case 1 :
                    // D:\\Projekty\\Protege4Workspace\\org.protege.editor.owl.examples.tab\\src\\org\\protege\\owl\\examples\\tab\\grammar\\FOLStage4.g:229:2: ^( IS ID arg )
                    {
                    root_0 = (CommonTree)adaptor.nil();

                    _last = (CommonTree)input.LT(1);
                    {
                    CommonTree _save_last_1 = _last;
                    CommonTree _first_1 = null;
                    CommonTree root_1 = (CommonTree)adaptor.nil();_last = (CommonTree)input.LT(1);
                    IS24=(CommonTree)match(input,IS,FOLLOW_IS_in_predcall314); 
                    IS24_tree = (CommonTree)adaptor.dupNode(IS24);

                    root_1 = (CommonTree)adaptor.becomeRoot(IS24_tree, root_1);



                    match(input, Token.DOWN, null); 
                    _last = (CommonTree)input.LT(1);
                    ID25=(CommonTree)match(input,ID,FOLLOW_ID_in_predcall316); 
                    ID25_tree = (CommonTree)adaptor.dupNode(ID25);

                    adaptor.addChild(root_1, ID25_tree);

                    _last = (CommonTree)input.LT(1);
                    pushFollow(FOLLOW_arg_in_predcall318);
                    arg26=arg();

                    state._fsp--;

                    adaptor.addChild(root_1, arg26.getTree());

                    match(input, Token.UP, null); adaptor.addChild(root_0, root_1);_last = _save_last_1;
                    }


                    		retval.resultTable = new ResultTable();
                    		try
                    		{
                    			if (negval)
                    			{
                    				retval.resultTable = predicateRegistry.getResults((ID25!=null?ID25.getText():null), (arg26!=null?arg26.resultTable:null));
                    			}
                    			else
                    			{
                    				retval.resultTable = predicateRegistry.getResults("NOT "+(ID25!=null?ID25.getText():null), (arg26!=null?arg26.resultTable:null));
                    			}
                    		}
                    		catch(Exception e)
                    		{
                    			e.printStackTrace();
                    			ErrorLogger.log(e);
                    		}
                    	

                    }
                    break;
                case 2 :
                    // D:\\Projekty\\Protege4Workspace\\org.protege.editor.owl.examples.tab\\src\\org\\protege\\owl\\examples\\tab\\grammar\\FOLStage4.g:250:2: ^( REL ID arg1= arg arg2= arg )
                    {
                    root_0 = (CommonTree)adaptor.nil();

                    _last = (CommonTree)input.LT(1);
                    {
                    CommonTree _save_last_1 = _last;
                    CommonTree _first_1 = null;
                    CommonTree root_1 = (CommonTree)adaptor.nil();_last = (CommonTree)input.LT(1);
                    REL27=(CommonTree)match(input,REL,FOLLOW_REL_in_predcall329); 
                    REL27_tree = (CommonTree)adaptor.dupNode(REL27);

                    root_1 = (CommonTree)adaptor.becomeRoot(REL27_tree, root_1);



                    match(input, Token.DOWN, null); 
                    _last = (CommonTree)input.LT(1);
                    ID28=(CommonTree)match(input,ID,FOLLOW_ID_in_predcall331); 
                    ID28_tree = (CommonTree)adaptor.dupNode(ID28);

                    adaptor.addChild(root_1, ID28_tree);

                    _last = (CommonTree)input.LT(1);
                    pushFollow(FOLLOW_arg_in_predcall335);
                    arg1=arg();

                    state._fsp--;

                    adaptor.addChild(root_1, arg1.getTree());
                    _last = (CommonTree)input.LT(1);
                    pushFollow(FOLLOW_arg_in_predcall339);
                    arg2=arg();

                    state._fsp--;

                    adaptor.addChild(root_1, arg2.getTree());

                    match(input, Token.UP, null); adaptor.addChild(root_0, root_1);_last = _save_last_1;
                    }


                    		retval.resultTable = new ResultTable();
                    		try
                    		{
                    			if (negval)
                    			{
                    				retval.resultTable = predicateRegistry.getResults((ID28!=null?ID28.getText():null), (arg1!=null?arg1.resultTable:null), (arg2!=null?arg2.resultTable:null));
                    			}
                    			else
                    			{
                    				retval.resultTable = predicateRegistry.getResults("NOT "+(ID28!=null?ID28.getText():null), (arg1!=null?arg1.resultTable:null), (arg2!=null?arg2.resultTable:null));
                    			}
                    		}
                    		catch(Exception e)
                    		{
                    			e.printStackTrace();
                    			ErrorLogger.log(e);
                    		}
                    	

                    }
                    break;

            }
            retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {
        }
        return retval;
    }
    // $ANTLR end "predcall"

    public static class arg_return extends TreeRuleReturnScope {
        public ResultTable resultTable;
        CommonTree tree;
        public Object getTree() { return tree; }
    };

    // $ANTLR start "arg"
    // D:\\Projekty\\Protege4Workspace\\org.protege.editor.owl.examples.tab\\src\\org\\protege\\owl\\examples\\tab\\grammar\\FOLStage4.g:272:1: arg returns [ResultTable resultTable] : ID ;
    public final FOLStage4.arg_return arg() throws RecognitionException {
        FOLStage4.arg_return retval = new FOLStage4.arg_return();
        retval.start = input.LT(1);

        CommonTree root_0 = null;

        CommonTree _first_0 = null;
        CommonTree _last = null;

        CommonTree ID29=null;

        CommonTree ID29_tree=null;

        try {
            // D:\\Projekty\\Protege4Workspace\\org.protege.editor.owl.examples.tab\\src\\org\\protege\\owl\\examples\\tab\\grammar\\FOLStage4.g:273:1: ( ID )
            // D:\\Projekty\\Protege4Workspace\\org.protege.editor.owl.examples.tab\\src\\org\\protege\\owl\\examples\\tab\\grammar\\FOLStage4.g:274:2: ID
            {
            root_0 = (CommonTree)adaptor.nil();

            _last = (CommonTree)input.LT(1);
            ID29=(CommonTree)match(input,ID,FOLLOW_ID_in_arg358); 
            ID29_tree = (CommonTree)adaptor.dupNode(ID29);

            adaptor.addChild(root_0, ID29_tree);


            		try
            		{
            			retval.resultTable = predicateRegistry.getArgResultTable((ID29!=null?ID29.getText():null));
            		}
            		catch(Exception e)
            		{
            			e.printStackTrace();
            			ErrorLogger.log(e);
            		}
            	

            }

            retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {
        }
        return retval;
    }
    // $ANTLR end "arg"

    // Delegated rules


 

    public static final BitSet FOLLOW_STAT_in_stat50 = new BitSet(new long[]{0x0000000000000004L});
    public static final BitSet FOLLOW_qtflist_in_stat52 = new BitSet(new long[]{0x0000000000083820L});
    public static final BitSet FOLLOW_expr_in_stat54 = new BitSet(new long[]{0x0000000000000008L});
    public static final BitSet FOLLOW_QTF_in_qtflist70 = new BitSet(new long[]{0x0000000000000004L});
    public static final BitSet FOLLOW_qtf_in_qtflist72 = new BitSet(new long[]{0x0000000000000148L});
    public static final BitSet FOLLOW_forall_in_qtf84 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_exists_in_qtf90 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_FORALL_in_forall101 = new BitSet(new long[]{0x0000000000000004L});
    public static final BitSet FOLLOW_rng_in_forall103 = new BitSet(new long[]{0x0000000000000008L});
    public static final BitSet FOLLOW_EXISTS_in_exists118 = new BitSet(new long[]{0x0000000000000004L});
    public static final BitSet FOLLOW_rng_in_exists120 = new BitSet(new long[]{0x0000000000000008L});
    public static final BitSet FOLLOW_varlist_in_rng139 = new BitSet(new long[]{0x0000000000020000L});
    public static final BitSet FOLLOW_EXPR_in_rng142 = new BitSet(new long[]{0x0000000000000004L});
    public static final BitSet FOLLOW_expr_in_rng144 = new BitSet(new long[]{0x0000000000000008L});
    public static final BitSet FOLLOW_VAR_in_varlist160 = new BitSet(new long[]{0x0000000000000004L});
    public static final BitSet FOLLOW_ID_in_varlist164 = new BitSet(new long[]{0x0000000000000408L});
    public static final BitSet FOLLOW_or_in_expr184 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_and_in_expr193 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_quark_in_expr202 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_OR_in_or222 = new BitSet(new long[]{0x0000000000000004L});
    public static final BitSet FOLLOW_expr_in_or226 = new BitSet(new long[]{0x0000000000083820L});
    public static final BitSet FOLLOW_expr_in_or230 = new BitSet(new long[]{0x0000000000000008L});
    public static final BitSet FOLLOW_AND_in_and251 = new BitSet(new long[]{0x0000000000000004L});
    public static final BitSet FOLLOW_expr_in_and255 = new BitSet(new long[]{0x0000000000083820L});
    public static final BitSet FOLLOW_expr_in_and259 = new BitSet(new long[]{0x0000000000000008L});
    public static final BitSet FOLLOW_predcall_in_quark278 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_NOT_in_quark289 = new BitSet(new long[]{0x0000000000000004L});
    public static final BitSet FOLLOW_predcall_in_quark291 = new BitSet(new long[]{0x0000000000000008L});
    public static final BitSet FOLLOW_IS_in_predcall314 = new BitSet(new long[]{0x0000000000000004L});
    public static final BitSet FOLLOW_ID_in_predcall316 = new BitSet(new long[]{0x0000000000000400L});
    public static final BitSet FOLLOW_arg_in_predcall318 = new BitSet(new long[]{0x0000000000000008L});
    public static final BitSet FOLLOW_REL_in_predcall329 = new BitSet(new long[]{0x0000000000000004L});
    public static final BitSet FOLLOW_ID_in_predcall331 = new BitSet(new long[]{0x0000000000000400L});
    public static final BitSet FOLLOW_arg_in_predcall335 = new BitSet(new long[]{0x0000000000000400L});
    public static final BitSet FOLLOW_arg_in_predcall339 = new BitSet(new long[]{0x0000000000000008L});
    public static final BitSet FOLLOW_ID_in_arg358 = new BitSet(new long[]{0x0000000000000002L});

}